package com.qiahao.mapper;

import com.qiahao.bean.Phone;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PhoneMapper {

    @Insert("insert into phone(phone,username,createtime) values (#{phone},#{userName},now()) ")
    void AddPhone(Phone phone);

    @InsertProvider(type = PhoneProvider.class,method = "insertAll")
    void AddPhoneList(List<Object> list);

    @Select("select * from phone order by createtime desc")
    List<Phone> getAllPhone();

    @Select("select * from phone a where a.phone = #{phone}")
    Phone findPhoneById(String phone);


}
